const n: Date = Object.create(new Date())
export const dateISO = (e: Date) => {
  if (e) {
    const t = e.valueOf()
    if (!isNaN(t)) return e.toISOString()
  }
  return new Date().toISOString()
}
export const getDate = (e: string | number | Date, t = n): Date => {
  if (e) {
    const t = new Date(e)
    if (!isNaN(t.valueOf())) return t
  }
  return t === n ? new Date() : t
}
